package com.example.my_test_2.repos;

import com.example.my_test_2.pojo.Purchase;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface SalesRepository extends JpaRepository<Purchase,Integer> {
    @Query("select p from Purchase p,Commodity c ,Shop s,User u where p.shop.shopId=s.shopId and p.commodity.commodityId=c.commodityId and p.user.userId=u.userId")
    public List<Purchase> findAllRecord();
}
